package practice3;

import java.util.concurrent.Callable;

public class getNum implements Callable {

    static int number = 0;
    @Override
    public Object call() throws Exception {
        while (true) {
            synchronized (getNum.class) {
                if(number == 100){
                    break;
                }else{
                    number++;
                    if(number%2!=0){
                        System.out.println(number);
                    }
                }
            }
        }
        return 0;
    }
}
